import 'package:flutter/material.dart';

class WidgetListItem extends StatefulWidget {
  WidgetListItem(
      {Key key,
      @required this.icon,
      @required this.title,
      @required this.centerContent});

  Widget icon;
  Widget title;
  Widget centerContent;

  @override
  State<StatefulWidget> createState() {
    return ListItemState();
  }
}

class ListItemState extends State<WidgetListItem> {
  @override
  Widget build(BuildContext context) {
    var width = MediaQuery.of(context).size.width;
    return Stack(
      fit: StackFit.loose,
      children: <Widget>[
        Padding(
            padding: EdgeInsets.only(top: 20),
            child: Container(
              width: width,
              child: Card(
                margin: EdgeInsets.all(10),
                elevation: 2,
                child: Column(
                  children: <Widget>[
                    Align(alignment: Alignment.topLeft,
                    child: Padding(padding: EdgeInsets.only(left: 55,top: 5),child: widget.title,)),
                    Padding(padding: EdgeInsets.only(top: 10)),
                    widget.centerContent
                  ],
                )
              ),
            )),
        Align(
            alignment: Alignment.topLeft,
            child: Padding(padding: EdgeInsets.only(left: 10,top: 5),
              child: Container(
              width: 50,
              height: 50,
              decoration:
              BoxDecoration(color: Colors.white, shape: BoxShape.circle ),
              child: widget.icon,
            ),)),
      ],
    );
  }
}
